import 'package:flutter/services.dart';

class GetBrightness {
  static var eventChannel = const EventChannel('brightness_event');
  static Stream get stream => eventChannel.receiveBroadcastStream();
  static var channel = const MethodChannel("brightness");
  static Future<void> startBrightnessStream() async {
    await channel.invokeMethod("startBrightnessStream", {"sliderValue": 50});
  }

  static Future<void> stopBrightnessStream() async {
    await channel.invokeMethod("stopBrightnessStream");
  }

//ios有效
  static Future<void> setSliderValue(double sliderValue) async {
    await channel.invokeMethod("setSliderValue", {"sliderValue": sliderValue});
  }
}
